package com.specificgroup.jira.plugin.acpro.action;

import com.atlassian.jira.web.action.JiraWebActionSupport;
import com.atlassian.jira.security.Permissions;

/**
 *
 * @author Ivan Holub
 */
public class AcproActionSupport extends JiraWebActionSupport {

    public boolean hasPermissions() {
        return isHasPermission(Permissions.ADMINISTER);
    }

    @Override
    public String doDefault() throws Exception {
        if (!hasPermissions()) {
            return PERMISSION_VIOLATION_RESULT;
        }
        return super.doDefault();
    }

    @Override
    protected String doExecute() throws Exception {
        if (!hasPermissions()) {
            return PERMISSION_VIOLATION_RESULT;
        }
        return super.doExecute();
    }
}
